<?php
   
    $host=""; // Host name 
    $username_db=""; // Mysql username 
    $password_db=""; // Mysql password 
    $db_name=""; // Database name 
    $tbl_name="events"; // Table name

    $conn = mysql_connect("$host", "$username_db", "$password_db")or die("cannot connect");
    mysql_select_db("$db_name")or die("cannot select DB");


    $event_name=$_POST["event_name"];
    $checkevent_name = mysql_query("SELECT event_name FROM events WHERE event_name='$event_name'");

    $event_name_exist = mysql_num_rows($checkevent_name);

    if($event_name_exist > 0 ){
        echo "Event Name already exist. Try again.";
        unset($event_name);
        print "<a href='submit-event.php'>Try Again</a>";
        //include 'register.html';
        exit();
    }
    
  ?>  
